// ComputingNetwork.ned
package gpusharing;

network ComputingNetwork {
    parameters:
        int numUsers = 20;
        int usersPerServer = 5;
    submodules:
        server[numUsers / usersPerServer]: TransferServer;
        userNode[numUsers]: UserNode;
    connections:
        for i=0..numUsers-1 {
            // 为 server 的 in 门指定索引
            userNode[i].out --> server[i / usersPerServer].in[i % usersPerServer];
            server[i / usersPerServer].out[i % usersPerServer] --> userNode[i].in;
        }
}